<?php
/**
 * 单个话题接口
 */
require_once dirname(dirname(__DIR__))."/common.php";

use app\cls\tom\Response;
use app\cls\tom\SysResource;
use app\model\Topic;

//分类ID
$topic_id=$_REQUEST['topic_id'];
if(empty($topic_id)){
    Response::output(-1,"参数错误1");
}

//实例化数据库
$db = SysResource::getDB(false);
$Topic = new Topic($db);

//查询单个话题信息
$one_topic=$Topic->one_topic($topic_id);
if(!empty($one_topic)){
    if(empty($one_topic['sub_desc'])){
        $one_topic['sub_desc']="";
    }
    Response::output(0,"查询成功",$one_topic);
}else{
    Response::output(0,"查询成功",[]);
}

